package com.datareport.data.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.datareport.data.entity.Role;
import com.datareport.data.mapper.RoleMapper;
import com.datareport.data.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author DataReport
 * @since 2021-11-17
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Autowired
    RoleMapper roleMapper;

    @Override
    public Role selectSuperAdmin() {

        Role role = roleMapper.selectOne(new QueryWrapper<Role>().eq("code", "super_admin"));

        return role;
    }

    @Override
    public Role selectAdmin() {
        Role role = roleMapper.selectOne(new QueryWrapper<Role>().eq("code", "admin"));

        return role;
    }
}
